<?php if(!in_array($data, array(null, '', '0'))):?>
<script type="text/javascript">
    setTimeout(function(){
        jQuery(".chzn-select").chosen();
    },1);
</script>
        <input name="id" type="hidden" value="<?php echo $data['id'];?>" />
        <p>
        	<label>Mã voucher</label>
            <span class="field" style="padding-top: 5px;font-size: 18px;">
                <b><?php echo $data['code_coupon'];?></b>
                <input name="code_coupon" type="hidden" value="<?php echo $data['code_coupon'];?>" />
				<input name="user_create" type="hidden" value="<?php echo $data['user_create'];?>" />
            </span>
        </p>
        <p style="display: none;">
        	<label>Mã Coupon QrCode</label>
            <span class="field" style="padding-top: 5px;">
                <?php echo $data['code_coupon_qrcode'];?>
            </span>
        </p>
        <p style="display: none;">
        	<label>Ảnh QrCode</label>
            <span class="field">
                <img src="<?php echo $imgbase.$data['img_qrcode'];?>" id="img_incens_show_" style="display: inline-block; vertical-align: middle;width: 100px;height: 95px;border: 1px solid #CCC;background: #CCC;" />
            </span>
        </p>
         <p>
    	<label>Thành viên </label>
           <span class="field" style="padding-top: 5px;">
                <?php echo $data['fullname'] ? $data['fullname'] : ( $data['username'] ? $data['username'] : 'Đang cập nhật' );?> 
				<?php echo $data['email'] ? '( '.$data['email'].' )' : '';?>
            </span>
        </p>
		 <p>
    	<label>Thời gian nhận  </label>
           <span class="field" style="padding-top: 5px;">
                <?php echo date('H:i:s d/m/Y', strtotime($data['created'])) ;?>
            </span>
        </p>
		<label>Nội dung </label>
           <span class="field" style="padding-top: 5px;">
                <?php echo $ctent ? $ctent : 'Đang cập nhật';?>
            </span>
        </p>
		
		
		<!-- lưu lịch sử nhân viên giao dịch -->
		
		<p>
			<label>Tên nhà hàng ( * )</label>
            <span class="field">
				<select name="restaurant_id">
					<?php echo $listRestaurant;?>
				</select>
			</span>
		</p>
		
		<p>
			<label>Ca làm việc ( * )</label>
            <span class="field">
			<input name="log_work_car" type="text" class="input-xlarge" value="" placeholder="Ca làm việc..." />
			</span>
		</p>
		
		<p>
			<label>Số bill ( * )</label>
            <span class="field">
			<input name="log_bills" type="text" class="input-xlarge" value="" placeholder="Số bill..." />
			</span>
		</p>
		
		<p>
			<label>Số khách ( * )</label>
            <span class="field">
			<input name="log_customers" type="text" class="input-xlarge" value="" placeholder="Số khách..." />
			</span>
		</p>
		
		<p>
			<label>Doanh thu ( * )</label>
            <span class="field">
			<input name="log_revenue" type="text" class="input-xlarge" value="" placeholder="Doanh thu..." />
			</span>
		</p>
		
		<p>
			<label>Tên khách hàng ( * )</label>
            <span class="field">
			<input name="log_customer" type="text" class="input-xlarge" value="" placeholder="Tên khách hàng..." />
			</span>
		</p>
		
		<p>
			<label>Số điện thoại ( * )</label>
            <span class="field">
			<input name="log_mobile" type="text" class="input-xlarge" value="" placeholder="Số điện thoại..." />
			</span>
		</p>
		
		<p>
			<label>Nội dung quà voucher ( * )</label>
            <span class="field">
			<input name="log_gift" type="text" class="input-xlarge" value="" placeholder="Nội dung quà voucher..." />
			</span>
		</p>
		
		<p>
        	<label>Xác nhận đã sử dụng voucher </label>
            <span class="field">
			<select name="active">
				<option value="1">Đã sử dụng</option>
			</select>
            </span>
        </p>
		
		<!-- -->
        <p>
            <label></label>
            <button class="btn btn-rounded" type="submit"> <i class="iconfa-ok"></i> &nbsp; Lưu</button>
        </p>
<?php else:?>
<?php die('404');?>
<?php endif;?>
<script>
$(function()
{   
    if($('#x2').is(':checked'))
    {
        $('#time_select_box').show();
    }else{
        $('#time_select_box').hide();
    }
    $('input[type=radio][name=incentives_type]').change(function()
    {
        var type = this.value;
        
        if(type == 1){
            $('#time_select_box').fadeIn('slow');    
        }else{
            $('#time_select_box').fadeOut('slow');
        }
    });
    if($('#r2').is(':checked'))
    {
        $('#restaurant_select_box').show();
    }else{
        $('#restaurant_select_box').hide();
    }
    $('input[type=radio][name=restaurant_target]').change(function()
    {
        var r_type = this.value;
        
        if(r_type == 1){
            $('#restaurant_select_box').fadeIn('slow');
        }else{
            $('#restaurant_select_box').fadeOut('slow');
        }
    });
});
</script>